// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_a;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.text.TextUtils;
import com.nnee.p_l.p_a.cls_a;
import com.nnee.p_pr.p_atom.cls_u;
import java.io.*;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.text.*;
import java.util.*;

// Referenced classes of package com.nnee.p_pr.a:
//            u

public class cls_i
{

    public cls_i()
    {
    }

    public static String a(long l)
    {
        return b().format(Long.valueOf(l));
    }

    public static String a(Context context)
    {
        if(b == null || b.length() == 0)
            b = b(context);
        return b;
    }

    public static String a(String s)
    {
        if(TextUtils.isEmpty(s) || s.equalsIgnoreCase("null"))
            s = null;
        return s;
    }

    public static String a(String s, char c1)
    {
        int j = 0;
        if(s != null && s.length() != 0) {
        	int k = s.indexOf(c1, j);
            if(k != -1)
            {
                int l = s.length();
                StringBuilder stringbuilder = new StringBuilder(s.length());
                do
                {
                    stringbuilder.append(s.substring(j, k));
                    j = k + 1;
                    k = s.indexOf(c1, j);
                } while(k != -1);
                if(j < l)
                    stringbuilder.append(s.substring(j, l));
                s = stringbuilder.toString();
            }
        } else{
        s = null;
        }
        return s;

    }

    public static String a(String s, int j)
    {
        String s1;
        int k=0;
 
        {
            int l;
            if(a(s, j, "http://"))
                k = "http://".length();
            else
            if(a(s, j, "www."))
                k = "www.".length();
            else
            if(a(s, j, "wap."))
            {
                k = "wap.".length();
            } else
            {
            	while(true)
                {
                    if(!a(s, j, "https://"))
                        break ;
                    k = "https://".length();
                }
            }
            l = s.length();
            do
            {
                if(j + k >= l)
                    break  ;
                char c1 = s.charAt(j + k);
                if(c1 >= 'A' && c1 <= 'Z' || c1 >= 'a' && c1 <= 'z' || c1 >= '0' && c1 <= '9')
                {
                    k++;
                } else
                {
                    if("!#$%&'()*+,-./:;=?@[\\]^_`{|}~".indexOf(c1) < 0)
                        break ;
                    k++;
                }
            } while(true);
        }
s1 = s.substring(j, k + j);
        return s1;
        
    }

    public static String a(String s, String s1, String s2)
    {
        return s.replace(s1, s2);
    }

    public static String a(String s, String as[], String s1)
    {
    	String s2 = "";
        if(s != null && s.length() != 0 && as != null && as.length != 0) {
        	int j = as.length;
            int k = 0;
            String s3;
            for(s2 = s; k < j; s2 = s3)
            {
                s3 = s2.replace(as[k], s1);
                k++;
            }

            if(s2 == null)
                s2 = "";
        }
        return s2;

    }

    private static DateFormat a()
    {
        if(f == null)
            f = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.US);
        return f;
    }

    public static Hashtable a(Hashtable hashtable)
    {
        Hashtable hashtable1;
        if(hashtable != null)
            hashtable1 = (Hashtable)hashtable.clone();
        else
            hashtable1 = null;
        return hashtable1;
    }

    public static Vector a(String s, String s1)
    {
        Vector vector = null;
        if(s != null && s.length() > 0 && s1 != null && s1.length() > 0) {
        	 String as[] = s.split(s1);
             if(as.length > 0)
             {
                 Vector vector1 = new Vector();
                 for(int j = 0; j < as.length; j++)
                     vector1.addElement(as[j]);

                 vector = vector1;
             }
        }

        return vector;

    }

    public static void a(LinkedList linkedlist, LinkedList linkedlist1)
    {
        if(linkedlist != null && linkedlist1 != null && linkedlist.size() != 0 && linkedlist1.size() != 0){
        	 int j = -1 + linkedlist1.size();
        	 while(true)
        	 {
        	 if(j < 0)
                 return;
             if(!((cls_u)linkedlist.get(0)).equals(linkedlist1.get(j))) {
            	 j--;
             }else {
            	 int k = linkedlist1.size() - j;
            	 
            	 if(k > linkedlist.size())
                     linkedlist.clear();
                 else
                 if(k >= 0)
                     linkedlist.subList(0, k).clear();
            	 
            	 return;
             }
        	 }
        }
    }

    public static void a(Vector vector)
    {
        int j = 0;
        if(vector != null && vector.size() > 0)
        {
            Object aobj[] = new Object[vector.size()];
            Object aobj1[] = new Object[vector.size()];
            vector.copyInto(aobj);
            vector.copyInto(aobj1);
            a(aobj, aobj1, j, aobj.length, j);
            for(; j < aobj1.length; j++)
                vector.setElementAt(aobj1[j], j);

        }
    }

    private static void a(Object aobj[], int j, int k)
    {
        Object obj = aobj[j];
        aobj[j] = aobj[k];
        aobj[k] = obj;
    }

    private static void a(Object aobj[], Object aobj1[], int j, int k, int l)
    {
        int i1 = k - j;
        if(i1 < 7)
        {
            for(int j3 = j; j3 < k; j3++)
            {
                for(int k3 = j3; k3 > j && ((Comparable)aobj1[k3 + -1]).compareTo(aobj1[k3]) > 0; k3--)
                    a(aobj1, k3, k3 + -1);

            }

        } else
        {
            int j1 = j + l;
            int k1 = k + l;
            int l1 = j1 + k1 >> 1;
            a(aobj1, aobj, j1, l1, -l);
            a(aobj1, aobj, l1, k1, -l);
            if(((Comparable)aobj[l1 + -1]).compareTo(aobj[l1]) <= 0)
            {
                System.arraycopy(((Object) (aobj)), j1, ((Object) (aobj1)), j, i1);
            } else
            {
                int i2 = l1;
                while(j < k) 
                {
                    int l2;
                    int i3;
                    if(i2 >= k1 || j1 < l1 && ((Comparable)aobj[j1]).compareTo(aobj[i2]) <= 0)
                    {
                        int j2 = j1 + 1;
                        aobj1[j] = aobj[j1];
                        int k2 = i2;
                        l2 = j2;
                        i3 = k2;
                    } else
                    {
                        i3 = i2 + 1;
                        aobj1[j] = aobj[i2];
                        l2 = j1;
                    }
                    j++;
                    j1 = l2;
                    i2 = i3;
                }
            }
        }
    }

    public static boolean a(int j, int k, int l)
    {
        boolean flag;
        flag = false;
        
        if(j > 0 && k > 0 && l > 0 && j >= k && (j - k) % l == 0)
            flag = true;
        return flag;
    }

    public static boolean a(File file, File file1)
    {
        FileInputStream fileinputstream=null;
		try {
			fileinputstream = new FileInputStream(file);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        boolean flag1 = a(((InputStream) (fileinputstream)), file1);
        boolean flag = flag1;
        try {
			fileinputstream.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
        flag = false;
        return flag;
    }

    public static boolean a(File file, String s)
    {
        boolean flag = false;
        if(file.exists()) {
        	 MessageDigest messagedigest;
             FileInputStream fileinputstream;
             try
             {
                 messagedigest = MessageDigest.getInstance("MD5");
                 byte abyte0[] = new byte[4096];
                 fileinputstream = new FileInputStream(file);
                 do
                 {
                     int j = fileinputstream.read(abyte0);
                     if(j <= 0)
                         break;
                     messagedigest.update(abyte0, 0, j);
                 } while(true);
             }
             catch(Exception exception)
             {
                 exception.printStackTrace();
                 return flag; /* Loop/switch isn't completed */
             }
             boolean flag1;
             try {
				fileinputstream.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
             String s1;
             for(s1 = (new BigInteger(1, messagedigest.digest())).toString(16); s1.length() < 32; s1 = (new StringBuilder()).append("0").append(s1).toString());
             flag1 = s.equals(s1);
             flag = flag1;
        }
        return flag;

    }

    public static boolean a(InputStream inputstream, File file)
    {
        boolean flag = false;
        FileOutputStream fileoutputstream;
		try {
			fileoutputstream = new FileOutputStream(file);
		
        byte abyte0[] = new byte[4096];
        do
        {
            int j = inputstream.read(abyte0);
            if(j < 0)
                break;
            fileoutputstream.write(abyte0, 0, j);
        } while(true);
        
        fileoutputstream.close();
        
        fileoutputstream.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        flag = true;
        
        return flag;
    }

    public static boolean a(String s, int j, String s1)
    {
    	boolean flag = false;
        int k = s1.length();
        if(j + k <= s.length()) {
        	int l = 0;
        
        	while(true)
            {
                if(l < k)
                {
                    int i1 = s.charAt(j + l);
                    if(i1 >= 65 && i1 <= 90)
                        i1 += 32;
                    if(i1 == s1.charAt(l))
                        break  ;
                }
                else
                {
                	break  ;
                }
                
                l++;
            }
        	
        	if(l == k && l > 0)
                flag = true;
            else
                flag = false;
        }
        return flag;
 
    }

    public static char[] a(byte abyte0[])
    {
        int j = 0;
        int k = abyte0.length;
        char ac[] = new char[k << 1];
        for(int l = j; l < k; l++)
        {
            int i1 = j + 1;
            ac[j] = i[(0xf0 & abyte0[l]) >>> 4];
            j = i1 + 1;
            ac[i1] = i[0xf & abyte0[l]];
        }

        return ac;
    }

    public static String b(long l)
    {
        String s;
        if(l < 1024L)
            s = (new StringBuilder()).append(l).append("B").toString();
        else
        if(l >= 1024L && l < 0x100000L)
        {
            int i1 = (int)(l / 1024L);
            int j1 = (int)(((l * 10L) / 1024L) % 10L);
            if(j1 > 0)
                s = (new StringBuilder()).append(i1).append(".").append(j1).append("K").toString();
            else
                s = (new StringBuilder()).append(i1).append("K").toString();
        } else
        {
            int j = (int)(l / 0x100000L);
            int k = (int)(((l * 10L) / 0x100000L) % 10L);
            if(k > 0)
                s = (new StringBuilder()).append(j).append(".").append(k).append("M").toString();
            else
                s = (new StringBuilder()).append(j).append("M").toString();
        }
        return s;
    }

    public static String b(Context context)
    {
        String s = "";
        try
        {
            s = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
        }
        catch(android.content.pm.PackageManager.NameNotFoundException namenotfoundexception)
        {
            namenotfoundexception.printStackTrace();
        }
        return s;
    }

    public static String b(String s)
    {
        Date date = new Date();
        if(a(s) != null) {
        	Date date2=null;
			try {
				date2 = a().parse(s);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            Date date1 = date2;
            
            if(date1 != null)
                s = b().format(date1);
        }else {
        	s = b().format(date);
        	
        	
        }

        return s;

    }

    public static String b(String s, String s1)
    {
        int j = 0;
        if(s != null && s.length() != 0){
        	int k = s.indexOf(s1, j);
            if(k != -1)
            {
                int l = s.length();
                int i1 = s1.length();
                StringBuilder stringbuilder = new StringBuilder(s.length());
                do
                {
                    stringbuilder.append(s.substring(j, k));
                    j = k + i1;
                    k = s.indexOf(s1, j);
                } while(k != -1);
                if(j < l)
                    stringbuilder.append(s.substring(j, l));
                s = stringbuilder.toString();
            }
        } else {s = null;}

        return s;

    }

    private static DateFormat b()
    {
        if(g == null)
            g = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
        return g;
    }

    public static long c(String s)
    {
        long l = 0L;
        if(a(s) != null) {
        	Date date1=null;
			try {
				date1 = a().parse(s);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            Date date = date1;
            
            if(date != null)
                l = date.getTime();
        }

        return l;
 
    }

    public static String c(Context context)
    {
        byte abyte0[] = e(context);
        String s;
        if(abyte0 == null || abyte0.length != 4)
            s = null;
        else
            s = Integer.toString(0xff & abyte0[0] | (0xff & abyte0[1]) << 8 | (0xff & abyte0[2]) << 16 | (0xff & abyte0[3]) << 24);
        return s;
    }

    public static String d(Context context)
    {
        int j = 0;
        byte abyte0[] = e(context);
        String s;
        if(abyte0 == null || abyte0.length != 4)
        {
            s = null;
        } else
        {
            byte abyte1[] = new byte[4];
            for(int k = j; k < abyte0.length; k++)
                abyte1[k] = abyte0[-1 + (abyte0.length - k)];

            String s1 = new String(a(abyte1));
            if(s1.length() % 2 != 0)
            {
                s = null;
            } else
            {
                String s2 = com.nnee.p_pr.p_a.cls_u.g(context);
                char c1;
                int l;
                StringBuilder stringbuilder;
                if(s2 != null && s2.length() >= 1)
                    c1 = s2.charAt(-1 + s2.length());
                else
                    c1 = '0';
                l = s1.length() / 2;
                stringbuilder = new StringBuilder();
                for(; j < l; j++)
                {
                    String s3 = Integer.toHexString(c1 ^ Integer.decode((new StringBuilder()).append("0x").append(s1.substring(j * 2, 2 * (j + 1))).toString()).intValue());
                    if(s3.length() <= 1)
                        stringbuilder.append('0');
                    stringbuilder.append(s3);
                }

                s = stringbuilder.toString();
            }
        }
        return s;
    }

    public static String d(String s)
    {
        if(s == null)
            s = "";
        return s;
    }

    public static boolean e(String s)
    {
        boolean flag;
        if(s == null || s.length() == 0)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public static byte[] e(Context context)
    {
        int j;
        byte abyte0[];
        byte abyte1[];
        InputStream inputstream;
        j = 0;
        abyte0 = null;
        try
        {
            abyte1 = new byte[21];
            int k = com.nnee.p_l.p_a.cls_a.b(1);
            if(k == -1)
                return null;
            inputstream = context.getResources().openRawResource(k);
            if(inputstream == null || inputstream.available() < 21)
            {
                if(inputstream != null)
                    inputstream.close();
                return null;
            }
        }
        catch(IOException ioexception)
        {
            ioexception.printStackTrace();
            return null;
        }
        byte abyte3[];
        try {
			if(inputstream.read(abyte1, 0, 21) != 21)
			{
			    inputstream.close();
			    return null;
			}
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
        byte abyte2[] = new byte[16];
        System.arraycopy(abyte1, 0, abyte2, 0, 16);
        if(abyte2 == null || abyte2.length != 16)
        	return null;
        for(; j < a.length; j++)
            if(a[j] != abyte2[j])
            	return null;

        if(abyte1[16] != 0)
        	return null;
        abyte3 = new byte[4];
        System.arraycopy(abyte1, 17, abyte3, 0, 4);
        abyte0 = abyte3;
        return abyte0;
    }

    public static boolean f(String s)
    {
        boolean flag = true;
        String s1 = (new StringBuilder()).append(s).append("_tmp").toString();
        try
        {
            Runtime runtime = Runtime.getRuntime();
            String as[] = new String[3];
            as[0] = "mv";
            as[1] = s;
            as[2] = s1;
            runtime.exec(as).waitFor();
            Runtime runtime1 = Runtime.getRuntime();
            String as1[] = new String[2];
            as1[0] = "mkdir";
            as1[1] = s;
            runtime1.exec(as1).waitFor();
            Runtime runtime2 = Runtime.getRuntime();
            String as2[] = new String[3];
            as2[0] = "rm";
            as2[1] = "-r";
            as2[2] = s1;
            runtime2.exec(as2);
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
            flag = false;
        }
        return flag;
    }

    public static String g(String s)
    {
        String as[] = new String[3];
        as[0] = "\u3000";
        as[1] = "\r";
        as[2] = "\n";
        return a(s, as, "");
    }

    static byte a[];
    public static String b = null;
    static final String c = "!#$%&'()*+,-./:;=?@[\\]^_`{|}~";
    private static final String d = "EEE MMM dd HH:mm:ss Z yyyy";
    private static final String e = "yyyy-MM-dd HH:mm";
    private static SimpleDateFormat f = null;
    private static SimpleDateFormat g = null;
    private static final int h = 7;
    private static final char i[];

    static 
    {
        byte abyte0[] = new byte[16];
        abyte0[0] = -10;
        abyte0[1] = 86;
        abyte0[2] = -63;
        abyte0[3] = -59;
        abyte0[4] = 108;
        abyte0[5] = -67;
        abyte0[6] = 70;
        abyte0[7] = -64;
        abyte0[8] = -67;
        abyte0[9] = 55;
        abyte0[10] = -101;
        abyte0[11] = -27;
        abyte0[12] = 54;
        abyte0[13] = -56;
        abyte0[14] = -37;
        abyte0[15] = 0;
        a = abyte0;
        char ac[] = new char[16];
        ac[0] = '0';
        ac[1] = '1';
        ac[2] = '2';
        ac[3] = '3';
        ac[4] = '4';
        ac[5] = '5';
        ac[6] = '6';
        ac[7] = '7';
        ac[8] = '8';
        ac[9] = '9';
        ac[10] = 'a';
        ac[11] = 'b';
        ac[12] = 'c';
        ac[13] = 'd';
        ac[14] = 'e';
        ac[15] = 'f';
        i = ac;
    }
}
